<template>
    <div class="big-box">
        <div class="header">
            <img src="../../../../../assets/bigScreen/header4.png" alt="" />
            <div class="backBox" @click="goBack"></div>
        </div>
        <div class="backToBox">
            <div class="backTo" @click="gotoHome">
                <div>返回总窗口</div>
            </div>
            <div class="backTo" @click="backToOne">
                <div>返回上一页</div>
            </div>
        </div>
        <div class="centerBox">
            <div class="sreenTitle">投资机构</div>
            <div class="center">

                <div class="top centerIn">
                    <div class="imgbox">
                        <img :src="detail.image[0] == '/' ? baseURL + detail.image : detail.image" alt="暂无图片" v-if="detail.image">
                        <img src="../../../../../assets/informition/active-default.png" alt="暂无图片" v-else>
                        <!-- <img :src="detail.image" alt=""> -->
                    </div>
                    <div class="top-content">
                        <div class="top-content-title">{{detail.name}}</div>
                        <div class="top-content-info">
                            <div class="flex" style="margin-right: 1rem">
                                <img src="../../../../../assets/capital/xingzhi.png" alt="" style="margin-right: 1rem">
                                <div>机构性质：{{detail.nature}}</div>
                            </div>
                            <div class="flex" style="margin-right: 1rem">
                                <img src="../../../../../assets/capital/address.png" alt="" style="margin-right: 1rem">
                                <div>注册地点：{{detail.address}}</div>
                            </div>
                            <div class="flex">
                                <img src="../../../../../assets/capital/zongbu.png" alt="" style="margin-right: 1rem">
                                <div>机构总部：{{detail.area}}</div>
                            </div>
                        </div>
                        <div class="top-content-info" style="justify-content: start;">
                            <div class="flex">
                                <img src="../../../../../assets/capital/xingzhi.png" alt="" style="margin-right: 1rem">
                                <div style="margin-right: 1rem">经营类型：{{detail.businessType}}</div>
                            </div>
                            <div class="flex">
                                <img src="../../../../../assets/capital/phone.png" alt="" style="margin-right: 1rem">
                                <div>联系方式：{{detail.phone}}</div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="add-box" id="title1">
                    <div class="add-title">机构简介</div>
                </div>
                <div class="text-box">{{detail.introduction}}</div>
                <div class="add-box" id="title2">
                    <div class="add-title">机构图片</div>
                </div>
                <div class="text-box">
                    <img :src="detail.image[0] == '/' ? baseURL + detail.image : detail.image" alt="暂无图片" v-if="detail.image">
                    <img src="../../../../../assets/informition/active-default.png" alt="暂无图片" v-else>
                    <!-- <img :src="detail.image" alt=""> -->
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import {
    baseUrl
} from '../../../../../../config';
import {
    capitalDetailRecommend1
} from "../../../../../api/globalSearch"
import { getInvestmentDetail } from "../../../../../api/capital"
// import { ref, reactive, onBeforeMount } from "vue"
// import { useRouter,useRoute } from 'vue-router';
export default {
    components: {
        // actTabs
    },
    data() {
        return {
            list: [],
            baseURL: undefined,
            wrapperStyle: {
                width: '20rem'
            },
            tabList: ['最新资讯', '最新活动'],
            tabAct: 1,
            detail: {},
            detList: []
        }
    },
    mounted() {
        console.log(this.$route.query.id);
        this.baseURL = baseUrl
        this.getDet(this.$route.query.id);
        // this.getDetList(this.$route.query.id);
    },
    methods: {
        getMatch() {
            // console.log(item.id);
            capitalDetailRecommend1({
                industry: this.detail.industry
            }).then((response) => {
                this.list.value = [];
                if (response.code == 200) {
                    this.list = response.data;
                } else {
                    this.list = []
                }
            }).catch(err => {
                this.list = []
            })
        },
        // 阻止点击的默认事件修改路由
        handleAnchorClick(e, link) {
            e.preventDefault();
            var srcolls = document.getElementById(link.href);
            srcolls.scrollIntoView({
                block: 'start',
                behavior: 'smooth'
            });
        },
        toDetail(item, type) {
            console.log(item.id);
            var url = '';
            if (type == 1) { //投资需求
                url = 'capitalDetail'
            }
            // if (type == 3) {
            // url = '/scientificOrgDetail'
            // }
            if (type == 2) { //投资人
                url = 'capitalPersonal'
            }
            this.$router.push({
                path: url,
                query: {
                    id: item.id
                }
            })
        },
        getDet(id) {
            getInvestmentDetail(id).then(res => {
                if (res.code === 200) {
                    this.detail = res.data;
                    this.getMatch();
                }
            })
        },
        // getDetList(id) {
        // 	getActivityDetList({id: id}).then(res=>{
        // 		if(res.code === 200) {
        // 			this.detList = res.data?res.data.list:[];
        // 		}
        // 	})
        // },
        // gotoDet(id) {
        // 	this.$router.push({
        // 		path: 'activitiesDetail',
        // 		query: {
        // 			id: id
        // 		}
        // 	})
        // }
        gotoHome() {
            this.$router.push({
                path: '/bigScreenIndex',
            })
        },
        backToOne() {
            console.log('11');
            this.$router.go(-1)
        },
        goBack() {
            this.$router.push('/chart')
        }
    }
}
</script>

<style scoped lang="scss">
@font-face {
    font-family: "ffa";
    src: url(../../../assets/bigScreen/fonts/DS-DIGIB.TTF);
}
ul,
li {
    list-style: none;
}
.big-box {
    background-color: #071c3b;
    height: 100vh;
}
.header {
    position: relative;
    text-align: center;
    position: relative;
    height: 19.1rem;

    .backBox {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 70rem;
        height: 10rem;
        cursor: pointer;
    }

    > img {
        width: 100%;
        max-height: 100%;
        margin-top: -1.1rem;
        image-rendering: -moz-crisp-edges; /* Firefox */
        image-rendering: -o-crisp-edges; /* Opera */
        image-rendering: -webkit-optimize-contrast; /* Webkit (non-standard naming) */
        image-rendering: crisp-edges;
        -ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
    }
}
.centerBox {
    width: 96%;
    margin: 0 auto;
    position: absolute;
    top: 14rem;
    left: 2%;
    .sreenTitle {
        background-image: url("../../../../../assets/bigScreen/sreenTitle.png");
        background-size: 100% 100%;
        height: 3.8rem;
        padding-left: 35px;
        font-weight: 600;
        color: #fff;
        display: flex;
        align-items: center;
    }
    .center {
        margin-top: 1rem;
        height: calc(100vh - 20rem);
        border: 1px solid;
        border-image: linear-gradient(
                130deg,
                #2385df 0%,
                rgba(35, 133, 223, 0.65) 92%
            )
            1;
        overflow-y: scroll;
        padding: 20px;

        .centerIn {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .flex {
            display: flex;
            align-items: center;
        }
        .top {
            width: 140rem;
            // width: 100%;
            // height: 24rem;
            background: url("../../../assets/plan-detail-bg.png") no-repeat;
            background-size: 100% 100%;
            margin: 0 auto;
            .top-content {
                // width: 136rem;
                text-align: center;
                // padding: 6rem 0;
                // margin: 0 auto;

                .top-content-title {
                    font-size: 3.2rem;
                    color: #fff;
                }

                .top-content-info {
                    display: flex;
                    justify-content: space-between;
                    font-size: 1.6rem;
                    color: #fff;
                    margin-top: 1rem;
                    img {
                        width: 2rem;
                        height: 2rem;
                    }
                }
            }
            .imgbox {
                width: 15rem;
                height: 15rem;
                margin-right: 2rem;
                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    border-radius: 50%;
                }
            }
        }

        .detail-content {
            width: 136rem;
            margin: 3rem auto 0;
        }

        .add-box {
            width: 136rem;
            height: 6.5rem;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid #4494ff46;
            .add-title {
                display: flex;
                align-items: center;
                font-size: 2.2rem;
                font-weight: bold;
                color: #fff;
                &::before {
                    content: "";
                    display: block;
                    width: 0.5rem;
                    height: 3rem;
                    background: #037aff;
                    margin-right: 1rem;
                }
            }
            .add-btn {
                width: 13rem;
                height: 4.5rem;
                text-align: center;
                line-height: calc(4.5rem - 4px);
                border-radius: 4px;
                border: 1px solid #037aff;
                font-size: 1.6rem;
                color: #037aff;
                cursor: pointer;
            }
        }

        .text-box {
            width: 136rem;
            padding: 2rem 0 4rem 0;
            margin: 0 auto;
            color: rgba(255, 255, 255, 0.85);
            font-size: 1.8rem;
            img {
                width: 100%;
                height: 50rem;
                object-fit: cover;
            }
        }

        .publish-button {
            width: 14rem;
            height: 4.8rem;
            border-radius: 4px;
            background: #037dff;
            font-size: 1.8rem;
            color: #ffffff;
            text-align: center;
            line-height: 4.8rem;
            margin: 2rem auto 6rem;
            cursor: pointer;
        }
    }
    ::-webkit-scrollbar {
        width: 5px;
        height: 10px;
    }

    /* 滚动条轨道 */
    ::-webkit-scrollbar-track {
        background-color: #234470;
    }

    /* 滚动条滑块 */
    ::-webkit-scrollbar-thumb {
        background-color: #061c57;
    }

    /* 鼠标悬停在滚动条上的滑块 */
    ::-webkit-scrollbar-thumb:hover {
        background-color: #555;
    }
}
.backToBox {
    position: absolute;
    top: 8rem;
    right: 2%;
    display: flex;
    z-index: 10;
    .backTo {
        background-image: url("../../../../../assets/bigScreen/backTo.png");
        color: #2dccff;
        background-size: 100% 100%;
        width: fit-content;
        padding: 2px 40px 10px 10px;
        font-weight: 600;
        cursor: pointer;
        margin-left: 10px;
        div {
            padding-top: 5px;
        }
    }
}
</style>
